<template>
    <el-menu :unique-opened='true' @select="select">
        <router-link to="/HomeView/HomePage" v-if="roleId == 4">
            <el-menu-item index="1">
                <img src="http://localhost:5173/src/assets/images/%E9%A6%96%E9%A1%B5%E9%BB%91.png" style="width: 15px;margin-right: 10px;">
                <span>首页</span>   
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/ClassManagement" v-if="roleId != 4">
            <el-menu-item index="2">
                <img :src="num == 2?'/src/assets/images/班级管理蓝.png':'/src/assets/images/班级管理.png'" style="width: 15px;margin-right: 10px;">
                <span>班级管理</span>
            </el-menu-item>
        </router-link>
        <el-sub-menu index="3">
            <template #title>
                <img :src="num == '3-1' || num == '3-2' || num == '3-3'?'/src/assets/images/日常蓝.png':'/src/assets/images/日常黑.png'" style="width: 15px;margin-right: 10px;">
                <span :style="num == '3-1' || num == '3-2' || num == '3-3'?'color:#409eff':''">日常</span>
            </template>
            <el-menu-item-group>
                <router-link to="/HomeView/BusinessTripDiary"><el-menu-item index="3-1" v-if="roleId != 4">出差记录</el-menu-item></router-link>
                <router-link to="/HomeView/LeaveRecord"><el-menu-item index="3-2">请假记录</el-menu-item></router-link>
                <router-link to="/HomeView/AttendanceStatistics"><el-menu-item index="3-3">考勤统计</el-menu-item></router-link>
            </el-menu-item-group>
        </el-sub-menu>
        <router-link to="/HomeView/UserManagement" v-if="roleId == 1 || roleId == 2">
            <el-menu-item index="4">
                <img :src="num == 4?'/src/assets/images/用户管理蓝.png':'/src/assets/images/用户管理黑u.png'" style="width: 15px;margin-right: 10px;">
                <span>用户管理</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/StudentRecords" v-if="roleId != 3 && roleId != 4">
            <el-menu-item index="5">
                <img :src="num == 5?'/src/assets/images/学生档案蓝.png':'/src/assets/images/学生档案.png'" style="width: 15px;margin-right: 10px;">
                <span>学生档案</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/LoggingSystem" v-if="roleId !=3 && roleId != 5">
            <el-menu-item index="6">
                <img :src="num == 6?'/src/assets/images/日志系统蓝.png':'/src/assets/images/日志系统黑.png'" style="width: 15px;margin-right: 10px;">
                <span>日志系统</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/StudentLogManagement" v-if="roleId == 3 || roleId == 5">
            <el-menu-item index="7">
                <img :src="num == 7?'/src/assets/images/日志系统蓝.png':'/src/assets/images/日志系统黑.png'" style="width: 15px;margin-right: 10px;">
                <span>学生日志管理</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/ApprovalSystem" v-if="roleId != 4 && roleId != 5">
            <el-menu-item index="8">
                <img :src="num == 8?'/src/assets/images/审核系统蓝.png':'/src/assets/images/审核系统黑.png'" style="width: 15px;margin-right: 10px;">
                <span>审核系统</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/StudentLeaveRecord" v-if="roleId == 3">
            <el-menu-item index="9">
                <img :src="num == 9?'/src/assets/images/Sleave1.png':'/src/assets/images/Sleave.png'" style="width: 15px;margin-right: 10px;">
                <span>学生请假记录</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/ProjectManagement" v-if="roleId != 5">
            <el-menu-item index="10">
                <img :src="num == 10?'/src/assets/images/项目管理蓝.png':'/src/assets/images/项目管理黑.png'" style="width: 15px;margin-right: 10px;">
                <span>项目管理</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/DepartmentManagement" v-if="roleId == 1 || roleId == 2">
            <el-menu-item index="11">
                <img :src="num == 11?'/src/assets/images/部门管理蓝.png':'/src/assets/images/部门管理.png'" style="width: 15px;margin-right: 10px;">
                <span>部门管理</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/SubjectManagement" v-if="roleId == 1 || roleId == 2">
            <el-menu-item index="12">
                <img :src="num == 12?'/src/assets/images/学科管理蓝.png':'/src/assets/images/学科管理.png'" style="width: 15px;margin-right: 10px;">
                <span>学科管理</span>
            </el-menu-item>
        </router-link>
        <el-sub-menu index="13"  v-if="roleId != 3 && roleId != 4">
            <template #title>
                <img :src="num == '13-1' || num == '13-2' || num == '13-3'?'/src/assets/images/sale1.png':'/src/assets/images/sale.png'" style="width: 15px;margin-right: 10px;">
                <span :style="num == '13-1' || num == '13-2' || num == '13-3'?'color:#409eff':''">销售管理</span>
            </template>
            <el-menu-item-group>
                <router-link to="/HomeView/SalesStatistics"><el-menu-item index="13-1">销售统计</el-menu-item></router-link>
                <router-link to="/HomeView/StudentData"><el-menu-item index="13-2">学生数据</el-menu-item></router-link>
                <router-link to="/HomeView/BulkEntry"><el-menu-item index="13-3">批量录入</el-menu-item></router-link>
            </el-menu-item-group>
        </el-sub-menu>
        <router-link to="/HomeView/PersonalInformation" v-if="roleId == 4">
            <el-menu-item index="14">
                <img :src="num == 14?'/src/assets/images/msg1.png':'/src/assets/images/msg.png'" style="width: 15px;margin-right: 10px;">
                <span>个人信息</span>
            </el-menu-item>
        </router-link>
        <router-link to="/HomeView/SystemSettings" v-if="roleId != 4">
            <el-menu-item index="15">
                <img :src="num == 15?'/src/assets/images/系统设置蓝.png':'/src/assets/images/系统设置黑.png'" style="width: 15px;margin-right: 10px;">
                <span>系统设置</span>
            </el-menu-item>
        </router-link>
    </el-menu>
</template>

<script setup>
import { ref } from 'vue';
let roleId = ref(sessionStorage.getItem("roleId"))
let num = ref("")
let select = (index) => {
    num.value = index
    console.log(num.value)
}
</script>
<style lang="less" scoped>

</style>